﻿
using MediatR;
using RBAC.Common.Domains.RabbitProject;
using RBAC.Common.Dto;
using RBAC.Common.infrastructures.interfaces;
using RBAC.Enum;

namespace RBAC.api.Application.commond.deepprocessing
{
    public class DeepprocessingImagesJokerHandler : IRequestHandler<DeepprocessingImagesJokerCommond, Rulst>
    {


        private readonly IbaseRpository<ProductionPutImages> _ProductionPutImages;



        public DeepprocessingImagesJokerHandler(IbaseRpository<ProductionPutImages> productionPutImages)
        {
            _ProductionPutImages = productionPutImages;
        }

        public async Task<Rulst> Handle(DeepprocessingImagesJokerCommond request, CancellationToken cancellationToken)
        {
            var query = new Rulst() { Code = (int)Reult.success };

            var list = new ProductionPutImages()
            {
                Stypeid = Typenum.加工企业,
                ProDuctionBasicid = request.ProDuctionBasicid,
                PutImages = request.getimaegs,
                Putid = 0
            };

            query.data = _ProductionPutImages.Add(list);

            return query;
        }
    }
}
